<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入easyui 的主题样式  和  easyui 提供的图标样式 -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css"
	charset=UTF-8 />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/icon.css" charset=UTF-8 />
<!-- 引入jquery 和  easyui.js   中文设置js-->
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"
	charset=UTF-8></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"
	charset=UTF-8></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"
	charset=UTF-8></script>
</head>
<script type="text/javascript">
$(function() {
	$('#uid').combobox({  
	    url:'searchuid',    
	    valueField:'id',    
	    textField:'text',
	    onSelect: function(rec){    
	    	var uid = $("#uid").combo('getText');  
	    	$.ajax({
				url:'findu',	
				type:'post',
				data:{'uid':uid},
				datatype:'text',
				success:function(data){
					$("#uname").val(data);
				}
        })
        }
	});  
	$("#save").linkbutton({
		onClick:function(){
			var pid = $("#pid").val();
			var pname = $("#pname").val();
			var pclass= $('input:radio[name="point"]:checked').val();
			var uid = $("#uid").combo('getText');
			console.log(uid);
			$.ajax({
				url:'savepoint',
				type:'post',
				data:{'pid':pid,'pname':pname,'uid':uid,'pclass':pclass},
				datatype:'text',
				success:function(data){
					if(data=='1'){
					$.messager.alert('success','添加成功！','info');
					$("#pname").val(""); //清空输入框
					$("#pid").val("");
					$('#uid').combobox('setValue', '');
					$("#uname").val("");
					}
				}
			})
			$("#canel").linkbutton({
			onClick:function(){
				$("#pname").val(""); //清空输入框
				$("#pid").val("");
				$('#uid').combobox('setValue', '');
				$("#uname").val("");
			}
			})
		}
	
	})
})
</script>
<body>
	<div name="point" align="center"  >
		<table border="1" cellpadding="1" cellspacing="1" bordercolor="gray">
			<tr>
				<td rowspan="1">配送点名称 ： <input id="pname" name="pname" /></td>
				<td>&nbsp;&nbsp; <input id="point1" name="point" type="radio" checked="checked" value="主线站点" />主线站点&nbsp;&nbsp;<input id="point2" name="point" type="radio" value="支线站点"/>支线站点  </td> 
			</tr>
			<tr>
				<td>管理员编码：<input class="easyui-combobox" editable="false" id="uid" name="uid" style="width:130px" ></td>
				<td>管理员名称：<input id="uname" name="uname" readOnly="true"  /></td>
			</tr>
			<tr>
				<td align="right"><button class="easyui-linkbutton" id="save">确&nbsp;&nbsp;定</button></td>
				<td align="left"><button class="easyui-linkbutton" id="canel">清&nbsp;&nbsp;空</button></td>
			</tr>
		</table>
	</div>
</body>
</html>